import {queryRolesList, updateUserRolesList} from '@/api/roles/roles'
import {resetRouter} from '@/router'
import * as outils from "outils";

const actions = {
  queryRolesList({commit, state}) {
    return new Promise((resolve, reject) => {
      queryRolesList().then(resp => {
        resolve(resp);
      }).catch(err => {
        reject(err);
      })
    })
  },

  updateUserRolesList({commit, state}, params) {
    return new Promise((resolve, reject) => {
      const {uid,flag, roles} = params;
      updateUserRolesList(uid, flag, roles).then(resp => {
        resolve(resp);
      }).catch(err => {
        reject(err);
      })
    })
  }
}

export default {
  actions
}
